<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="app">
        <button @click="index--">上一张</button>
        <img :src="list[index]" alt=""></img>
        <button @click="index++">下一张</button>
    </div>
    <script>
        const { createApp } = Vue
        createApp({
            data() {
                return {
                    index: 0,
                    list: [
                        './images/t1.gif',
                        './images/t2.jpg',
                        './images/t3.jpg',
                        './images/t4.jpg',
                        './images/t5.jpg',
                        './images/t6.jpg',
                    ]
                }
            }
        }).mount('#app')
    </script>
</body>

</html>